//
// CMRMParameters.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

public class CMRMParameters {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CMRMParameters(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CMRMParameters obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CMRMParameters(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void setNLods(long value) {
    nel3dJNI.CMRMParameters_NLods_set(swigCPtr, this, value);
  }

  public long getNLods() {
    return nel3dJNI.CMRMParameters_NLods_get(swigCPtr, this);
  }

  public void setDivisor(long value) {
    nel3dJNI.CMRMParameters_Divisor_set(swigCPtr, this, value);
  }

  public long getDivisor() {
    return nel3dJNI.CMRMParameters_Divisor_get(swigCPtr, this);
  }

  public void setSkinReduction(CMRMParameters.TSkinReduction value) {
    nel3dJNI.CMRMParameters_SkinReduction_set(swigCPtr, this, value.swigValue());
  }

  public CMRMParameters.TSkinReduction getSkinReduction() {
    return CMRMParameters.TSkinReduction.swigToEnum(nel3dJNI.CMRMParameters_SkinReduction_get(swigCPtr, this));
  }

  public void setDistanceFinest(float value) {
    nel3dJNI.CMRMParameters_DistanceFinest_set(swigCPtr, this, value);
  }

  public float getDistanceFinest() {
    return nel3dJNI.CMRMParameters_DistanceFinest_get(swigCPtr, this);
  }

  public void setDistanceMiddle(float value) {
    nel3dJNI.CMRMParameters_DistanceMiddle_set(swigCPtr, this, value);
  }

  public float getDistanceMiddle() {
    return nel3dJNI.CMRMParameters_DistanceMiddle_get(swigCPtr, this);
  }

  public void setDistanceCoarsest(float value) {
    nel3dJNI.CMRMParameters_DistanceCoarsest_set(swigCPtr, this, value);
  }

  public float getDistanceCoarsest() {
    return nel3dJNI.CMRMParameters_DistanceCoarsest_get(swigCPtr, this);
  }

  public CMRMParameters() {
    this(nel3dJNI.new_CMRMParameters(), true);
  }

  public final static class TSkinReduction {
    public final static TSkinReduction SkinReductionMin = new TSkinReduction("SkinReductionMin", nel3dJNI.CMRMParameters_SkinReductionMin_get());
    public final static TSkinReduction SkinReductionMax = new TSkinReduction("SkinReductionMax");
    public final static TSkinReduction SkinReductionBest = new TSkinReduction("SkinReductionBest");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TSkinReduction swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TSkinReduction.class + " with value " + swigValue);
    }

    private TSkinReduction(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TSkinReduction(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TSkinReduction(String swigName, TSkinReduction swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TSkinReduction[] swigValues = { SkinReductionMin, SkinReductionMax, SkinReductionBest };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
